package com.rmi.service;

import com.rmi.IHelloService;
import com.rmi.impl.HelloServiceImpl;

import java.net.MalformedURLException;
import java.rmi.AlreadyBoundException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

public class Server {

    public static void main(String[] args) throws RemoteException, AlreadyBoundException, MalformedURLException {

        IHelloService helloService  = new HelloServiceImpl();


        LocateRegistry.createRegistry(8088);



        Naming.bind("rmi://127.0.0.1:8088/hello",helloService);

        System.out.println("绑定成功");





    }
}
